import { dictionarySave } from "$api/dictionary"
import { colors, imgs } from "$utils/imgs"

export default {
  data() {
    return {
      colors: colors,
      icons: imgs,
      addForm: {
        editable: true,
        form: {
          dicName: "taskType",
          dicValue: "",
          selectBg: "a7"
        }
      },
      taskTypeOp: [],
      priorityOp: []
    }
  },
  methods: {
    async save() {
      const { selectBg } = this.addForm.form || {}
      const remark = {
        selectBg
      }
      console.log(remark, "remark");
      const params = {
        ...this.addForm.form,
        remark: JSON.stringify(remark),
      }
      await dictionarySave(params)
      this.appMessage("操作成功", 0)
      setTimeout(() => {
        uni.navigateBack()
      }, 500)
    },
  }
}
